package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.OverflowList;
import com.atguigu.jxc.service.OverflowListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author lfh
 * @version 1.0
 * @date 2021/5/15 17:36
 */
@RestController
@RequestMapping("/overflowListGoods")
public class OverflowListGoodsController {

    @Autowired
    private OverflowListGoodsService overflowListGoodsService;

    // http://localhost:8080/overflowListGoods/save?overflowNumber=BY1605767033015

    /**
     * 新增报溢单
     * @param overflowList
     * @param overflowListGoodsStr
     * @return
     */
    @PostMapping("/save")
    public ServiceVO save(OverflowList overflowList, String overflowListGoodsStr, String overflowNumber){
        return overflowListGoodsService.save(overflowList,overflowListGoodsStr,overflowNumber);
    }

    // http://localhost:8080/overflowListGoods/list
    // 报溢单查询
    @PostMapping("/list")
    public Map<String,Object> getOverflowList(String  sTime, String  eTime){
        return overflowListGoodsService.getOverflowList(sTime,eTime);
    }

    // http://localhost:8080/overflowListGoods/goodsList
    // 报溢单商品信息
    @PostMapping("/goodsList")
    public Map<String,Object> getvOerflowListGoods(Integer overflowListId){
        return overflowListGoodsService.getvOerflowListGoods(overflowListId);
    }
}
